package com.ruoyi.pims.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pims.mapper.RySalesSummaryMapper;
import com.ruoyi.pims.domain.RySalesSummary;
import com.ruoyi.pims.service.IRySalesSummaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-18
 */
@Service
public class RySalesSummaryServiceImpl implements IRySalesSummaryService 
{
    @Autowired
    private RySalesSummaryMapper rySalesSummaryMapper;

    /**
     * 查询销售汇总
     * 
     * @param summaryId 销售汇总主键
     * @return 销售汇总
     */
    @Override
    public RySalesSummary selectRySalesSummaryBySummaryId(Long summaryId)
    {
        return rySalesSummaryMapper.selectRySalesSummaryBySummaryId(summaryId);
    }

    /**
     * 查询销售汇总列表
     * 
     * @param rySalesSummary 销售汇总
     * @return 销售汇总
     */
    @Override
    public List<RySalesSummary> selectRySalesSummaryList(RySalesSummary rySalesSummary)
    {
        return rySalesSummaryMapper.selectRySalesSummaryList(rySalesSummary);
    }

    /**
     * 新增销售汇总
     * 
     * @param rySalesSummary 销售汇总
     * @return 结果
     */
    @Override
    public int insertRySalesSummary(RySalesSummary rySalesSummary)
    {
        rySalesSummary.setCreateTime(DateUtils.getNowDate());
        return rySalesSummaryMapper.insertRySalesSummary(rySalesSummary);
    }

    /**
     * 修改销售汇总
     * 
     * @param rySalesSummary 销售汇总
     * @return 结果
     */
    @Override
    public int updateRySalesSummary(RySalesSummary rySalesSummary)
    {
        return rySalesSummaryMapper.updateRySalesSummary(rySalesSummary);
    }

    /**
     * 批量删除销售汇总
     * 
     * @param summaryIds 需要删除的销售汇总主键
     * @return 结果
     */
    @Override
    public int deleteRySalesSummaryBySummaryIds(String summaryIds)
    {
        return rySalesSummaryMapper.deleteRySalesSummaryBySummaryIds(Convert.toStrArray(summaryIds));
    }

    /**
     * 删除销售汇总信息
     * 
     * @param summaryId 销售汇总主键
     * @return 结果
     */
    @Override
    public int deleteRySalesSummaryBySummaryId(Long summaryId)
    {
        return rySalesSummaryMapper.deleteRySalesSummaryBySummaryId(summaryId);
    }
}
